package com.tree.validationdemo.constraint;

import com.tree.validationdemo.validator.GenderValidator;

import javax.validation.Constraint;
import javax.validation.Payload;
import java.lang.annotation.*;

/**
 * @author zhong
 * @version 1
 * @date 2022/04/10
 * @contact 1478168700@qq.com
 **/
@Target(value = {ElementType.METHOD, ElementType.FIELD})
@Retention(RetentionPolicy.RUNTIME)
@Documented
@Constraint(validatedBy = GenderValidator.class)
public @interface Gender {

    String message() default "gender性别值需为男或者女";

    Class<?>[] groups() default {};

    Class<? extends Payload>[] payload() default {};
}
